import { useState } from 'react';

export default () => {
  const [isMobile, setIsMobile] = useState(window.innerWidth <= 768);
  const [stationListData, setStationListData] = useState<any>([]);

  window.addEventListener('resize', () => {
    setIsMobile(window.innerWidth <= 768);
  });
  const [activeData, setActiveData] = useState<any>({}); // 交互数据
  const [dataModalType, setDataModalType] = useState<number | string>(0);
  const [isGuideShow, setIsGuideShow] = useState<any>(false);
  const [modalShow, setModalShow] = useState<any>({
    isThumbnailShow: true,
    isIntroShow: true,
    isListShow: false,
    isGuideShow: false,
  });
  const [instanceConf, setInstanceConf] = useState<any>({});
  const [panoramaData, setPanoramaData] = useState<any>({});
  const [toPanoramaId, setToPanoramaId] = useState<any>();
  const [allPanoramas, setAllPanoramas] = useState<API.PanoramaVo[]>([]);

  const [dialogInfo, setDialogInfo] = useState<any>({});

  return {
    stationListData,
    setStationListData,
    modalShow,
    setModalShow,
    isMobile,
    setIsMobile,
    isGuideShow,
    setIsGuideShow,
    instanceConf,
    setInstanceConf,
    panoramaData,
    setPanoramaData,
    toPanoramaId,
    setToPanoramaId,
    allPanoramas,
    setAllPanoramas,
    dataModalType,
    setDataModalType,
    dialogInfo,
    setDialogInfo,
    activeData,
    setActiveData,
  };
};
